<%@ page language="java" import="java.util.*,java.text.SimpleDateFormat,cn.bupt.adt.constant.Constants" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page  isELIgnored="false"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String ip = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/";
%>
<%
	//分页
	//currentPage就是当前页，allPages表示的就是一共有多少页。这些在后面都会用到  
	int currentPage = 0, allPages = 0;
	if (request.getAttribute("currentPage") != null) {
		currentPage = Integer.parseInt(request.getAttribute(
				"currentPage").toString());
	}
	if (request.getAttribute("allPages") != null) {
		allPages = Integer.parseInt(request.getAttribute("allPages")
				.toString());
	}
	//本页面url，翻页用
	String url = "doctorManagement/lookupdetail";
	request.setAttribute("url", url);
	SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
	String year = sdf.format(new Date());
	request.setAttribute("nowyear", year);
	request.setAttribute("imageRootPath",ip+Constants.IMAGE_PATH);
%>
<!DOCTYPE html>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title></title>
    

	<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
	<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/bootstrap.min.css" />

    <link href="<%=request.getContextPath()%>/assets/css/font-awesome.css" rel="stylesheet" />
    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
	<script src="<%=request.getContextPath()%>/assets/js/jquery-1.10.2.js" type="text/javascript"></script>
	<script  type="text/javascript" src="js/layer/layer.js" ></script>
	<script src="assets/js/bootstrap.js"></script>
	<link rel="stylesheet" href="layerui/css/layui.css"><link>
		<link href="assets/css/bootstrap-fileupload.min.css" rel="stylesheet" />
	 <link rel="stylesheet" href="css/Orderfont.css"><link>
	<script type="text/javascript" src="layerui/layui.js"></script>
	<script type="text/javascript" src="js/public/buttonModal.js"></script>
	<script type="text/javascript" src="js/public/submitForm.js"></script>
	  </head>
  <c:if test="${!empty oper_message }">
  	<script type="text/javascript">
  		alert("${oper_message}");
  	</script>
  </c:if>
  <body>
		  <div class="page-header">
		  		<h1><small>医生详情<i class="icon-double-angle-right"></i></small></h1>
			</div>
  	<div class="container">
  				</div>
                        <div class="panel-body">
                            <form method="post" role="form" action="doctorManagement/modifyDoctor" class="form-horizontal" enctype="multipart/form-data" >
                                        <%--姓名 --%>
                                        <input type="hidden" value="${item.id }" name="id">
	                                     <div class="form-group">
	                                          <label for="name" class="control-label col-sm-3">姓名</label>
	                                          <div class="col-sm-6">
	                                          	<input class="form-control" type="text" name="name" id="name" value="${item.name }"> 
	                                          </div>
	                                      </div>
                                 		
                                        <%--电话 --%>
	                                     <div class="form-group">
	                                          <label for="phone" class="control-label col-sm-3">电话</label>
	                                          <div class="col-sm-6">
	                                          	<input class="form-control" type="text" name="phone" id="phone" value="${item.phone }"> 
	                                          </div>
	                                      </div>                                        
                                        <%--年龄 --%>
	                                     <div class="form-group">
	                                          <label for="phone" class="control-label col-sm-3">年龄</label>
	                                          <div class="col-sm-6">
	                                          	<label class="form-control">${item.age}<%-- ${nowyear - fn:substring(item.identificationNumber,6,10)} --%></label>
	                                          </div>
	                                      </div> 
                                        <%--身份证号 --%>
                                 		<div class="form-group">
<%--                                             <select class="col-sm-3"  name="idenType" id="degree" style="width: 20%px;">
                                            	<option <c:if test="${item.idenType == true}">selected="selected" </c:if> value="true">身份证</option>
                                            	<option <c:if test="${item.idenType == false}">selected="selected"</c:if> value="false">军官证</option>
                                            </select> --%>
                          		       	<c:choose>
                          		       		<c:when test="${item.idenType == true }">
                          		       			<label for="identification" class="control-label col-sm-3">身份证号码</label>
                          		       		</c:when>
                          		       		<c:otherwise>
                          		       			<label for="identification" class="control-label col-sm-3">军官证号码</label>
                          		       		</c:otherwise>
                          		       	</c:choose>                                            
	                                          <div class="col-sm-6">
	                                          		<input class="form-control" type="text" name="identificationNumber" id="identificationNumber" value="${item.identificationNumber }">
	                                          		身份证<input type="radio" name="idenType" value="true" <c:if test="${item.idenType == true}">checked="checked"</c:if> /> 
	                                          		军官证<input type="radio" name="idenType" value="false" <c:if test="${item.idenType == false}">checked="checked"</c:if> /> 
	                                          </div>
                                        </div>  
                                        <%--学历 --%>
                                 		<div class="form-group">
                                            <label for="degree" class="control-label col-sm-3">学历</label>
                                            <div class="col-sm-6">
                                            <select class="form-control"  name="degree" id="degree">
                                            	<option <c:if test="${item.degree eq '专科'}">selected="selected"</c:if> >专科</option>
                                            	<option <c:if test="${item.degree eq '本科'}">selected="selected"</c:if>>本科</option>
                                            	<option <c:if test="${item.degree eq '硕士'}">selected="selected"</c:if>>硕士</option>
                                            	<option <c:if test="${item.degree eq '博士'}">selected="selected"</c:if>>博士</option>
                                            </select>
                                            </div>
                                        </div>
                                        <%--职称 --%>
                                 		<div class="form-group">
	                                          <label for="identification" class="control-label col-sm-3">职称</label>
	                                          <div class="col-sm-6">
	                                          	<input class="form-control" type="text" name="professionalTitle" id="professionalTitle" value="${item.professionalTitle }"> 
	                                          </div>
                                        </div>                                         
                                        <%--医生标签 --%>
                                 		<div class="form-group">
                                            <label for="degree" class="control-label col-sm-3">医生标签</label>
                                            <div class="col-sm-6">
                                            	<c:forEach var="item_oper" items="${operationTypes }">
                                            	<div class="checkbox">
                                            		<input type="checkbox" value="${item_oper.id} " name="operationType" <c:if test="${fn:contains(item.labels, item_oper.operationTypeName)}">checked="checked" </c:if> >${item_oper.operationTypeName} 
                                            	</div>
                                            	</c:forEach>
												
                                            </div>
                                        </div>     
                                        <%--电话 --%>
	                                     <div class="form-group">
	                                          <label for="aliAccount" class="control-label col-sm-3">支付宝账号</label>
	                                          <div class="col-sm-6">
	                                          	<input class="form-control" type="text" name="aliAccount" id="aliAccount" value="${item.aliAccount }"> 
	                                          </div>
	                                      </div>                                           
                                        <%--证件照 --%>
                                 		<div class="form-group">
					                        <label class="control-label col-sm-3">证件照照片</label>
					                        <div class="col-sm-3">
					                            <div class="fileupload fileupload-new" data-provides="fileupload">
					                            <div class="fileupload-preview thumbnail" style="width: 200px; height: 150px;"></div>
					                                <div>
					                                	<button id="bt-potr" class="btn btn-info">查看证件照</button>
					                                    <span class="btn btn-file btn-success"><span class="fileupload-new">修改照片</span><span class="fileupload-exists">更改照片</span><input type="file" name="portr" accept="image/*"></span>
					                                    <a href="#" class="btn btn-danger fileupload-exists" data-dismiss="fileupload">移除</a>
					                                </div>
					                            </div>
					                        </div>	
                                        </div> 
                                        <%--身份证正面照片 --%>
                                 		<div class="form-group">
					                        <label class="control-label col-sm-3">身份证正照片</label>
					                        <div class="col-sm-3">
					                            <div class="fileupload fileupload-new" data-provides="fileupload">
					                            <div class="fileupload-preview thumbnail" style="width: 200px; height: 150px;"></div>
					                                <div>
					                                	<button id="bt-idenPos" class="btn btn-info">查看</button>
					                                    <span class="btn btn-file btn-success"><span class="fileupload-new">修改照片</span><span class="fileupload-exists">更改照片</span><input type="file" name="idPos" accept="image/*"></span>
					                                    <a href="#" class="btn btn-danger fileupload-exists" data-dismiss="fileupload">移除</a>
					                                </div>
					                            </div>
					                        </div>	
                                        </div> 
                                        <%--身份证反面照片 --%>
                                 		<div class="form-group">
					                        <label class="control-label col-sm-3">身份证反面照片</label>
					                        <div class="col-sm-3">
					                            <div class="fileupload fileupload-new" data-provides="fileupload">
					                            <div class="fileupload-preview thumbnail" style="width: 200px; height: 150px;"></div>
					                                <div>
					                                	<button id="bt-idenNeg" class="btn btn-info">查看</button>
					                                    <span class="btn btn-file btn-success"><span class="fileupload-new">修改照片</span><span class="fileupload-exists">更改照片</span><input type="file" name="idNeg" accept="image/*"></span>
					                                    <a href="#" class="btn btn-danger fileupload-exists" data-dismiss="fileupload">移除</a>
					                                </div>
					                            </div>
					                        </div>	
                                        </div>                                                                                                                          
                                        <%--学历证书照片 --%>
                                 		<div class="form-group">
					                        <label class="control-label col-sm-3">学位证照片</label>
					                        <div class="col-sm-3">
					                            <div class="fileupload fileupload-new" data-provides="fileupload">
					                            <div class="fileupload-preview thumbnail" style="width: 200px; height: 150px;"></div>
					                                <div>
					                                	<button id="bt-deg" class="btn btn-info">查看学历证</button>
					                                    <span class="btn btn-file btn-success"><span class="fileupload-new">修改照片</span><span class="fileupload-exists">更改照片</span><input type="file" name="deg" accept="image/*"></span>
					                                    <a href="#" class="btn btn-danger fileupload-exists" data-dismiss="fileupload">移除</a>
					                                </div>
					                            </div>
					                        </div>	
                                        </div> 
                                        <%--毕业证书照片 --%>
                                 		<div class="form-group">
					                        <label class="control-label col-sm-3">毕业证照片</label>
					                        <div class="col-sm-3">
					                            <div class="fileupload fileupload-new" data-provides="fileupload">
					                            <div class="fileupload-preview thumbnail" style="width: 200px; height: 150px;"></div>
					                                <div>
					                                	<button id="bt-grad" class="btn btn-info">查看毕业证</button>
					                                    <span class="btn btn-file btn-success"><span class="fileupload-new">修改照片</span><span class="fileupload-exists">更改照片</span><input type="file" name="gra" accept="image/*"></span>
					                                    <a href="#" class="btn btn-danger fileupload-exists" data-dismiss="fileupload">移除</a>
					                                </div>
					                            </div>
					                        </div>	
                                        </div>    
                                        <%--从业资格证书照片 --%>
                                 		<div class="form-group">
					                        <label class="control-label col-sm-3">医生从业资格证照片</label>
					                        <div class="col-sm-3">
					                            <div class="fileupload fileupload-new" data-provides="fileupload">
					                            <div class="fileupload-preview thumbnail" style="width: 200px; height: 150px;"></div>
					                                <div>
					                                	<button id="bt-qua" class="btn btn-info">查看</button>
					                                    <span class="btn btn-file btn-success"><span class="fileupload-new">修改照片</span><span class="fileupload-exists">更改照片</span><input type="file" name="qua" accept="image/*"></span>
					                                    <a href="#" class="btn btn-danger fileupload-exists" data-dismiss="fileupload">移除</a>
					                                </div>
					                            </div>
					                        </div>	
                                        </div>          
                                        <%--执业证书照片 --%>
                                 		<div class="form-group">
					                        <label class="control-label col-sm-3">医生执业证照片</label>
					                        <div class="col-sm-3">
					                            <div class="fileupload fileupload-new" data-provides="fileupload">
					                            <div class="fileupload-preview thumbnail" style="width: 200px; height: 150px;"></div>
					                                <div>
					                                	<button id="bt-cert" class="btn btn-info">查看</button>
					                                    <span class="btn btn-file btn-success"><span class="fileupload-new">修改照片</span><span class="fileupload-exists">更改照片</span><input type="file" name="cert" accept="image/*"></span>
					                                    <a href="#" class="btn btn-danger fileupload-exists" data-dismiss="fileupload">移除</a>
					                                </div>
					                            </div>
					                        </div>	
                                        </div>
                                        <%--职称证书照片 --%>
                                 		<div class="form-group">
					                        <label class="control-label col-sm-3">医生职称证照片</label>
					                        <div class="col-sm-3">
					                            <div class="fileupload fileupload-new" data-provides="fileupload">
					                            <div class="fileupload-preview thumbnail" style="width: 200px; height: 150px;"></div>
					                                <div>
					                                	<button id="bt-pro" class="btn btn-info">查看</button>
					                                    <span class="btn btn-file btn-success"><span class="fileupload-new">修改照片</span><span class="fileupload-exists">更改照片</span><input type="file" name="pro" accept="image/*"></span>
					                                    <a href="#" class="btn btn-danger fileupload-exists" data-dismiss="fileupload">移除</a>
					                                </div>
					                            </div>
					                        </div>	
                                        </div>                                                                                                                                                                                                                                                                                                                                                      
                                     		<button  class="btn btn-info" id="sm" >保存信息</button>
                                     		<a class="btn btn-info"  href="doctorManagement/index/1">返回医生列表</a>
                                    </form>
                                    
                                    
                                    
                                    <%--身份证正照片 --%>                                      
										<div id="idenPos" class="modal fade">
								      		<div class="modal-dialog " >
								      			<div class="modal-content">
								      				<div class="modal-header">
								      					 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> 
								      				</div>
								      				<div class="modal-body">
								      				<div>
								      					<img alt="身份证正反照片" src="${imageRootPath}${item.identificationPosImg}" style="height: 100%;width: 100%">
								      					</div>
								      				</div>
								      			</div>
								      		</div>
										</div>
                                    <%--身份证反照片 --%>                                      
										<div id="idenNeg" class="modal fade">
								      		<div class="modal-dialog " >
								      			<div class="modal-content">
								      				<div class="modal-header">
								      					 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> 
								      				</div>
								      				<div class="modal-body">
								      				<div>
								      					<img alt="身份证正反照片" src="${imageRootPath}${item.identificationNegImg}" style="height: 100%;width: 100%">
								      					</div>
								      				</div>
								      			</div>
								      		</div>
										</div>
                                    <%--证件照片 --%>                                      
										<div id="potr" class="modal fade">
								      		<div class="modal-dialog " >
								      			<div class="modal-content">
								      				<div class="modal-header">
								      					 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> 
								      				</div>
								      				<div class="modal-body">
									      				<div>
									      					<img alt="身份证正反照片" src="${imageRootPath}${item.portrait}" style="height: 100%;width: 100%">
									      				</div>
								      				</div>
								      			</div>
								      		</div>
										</div>
                                    <%--学位照片 --%>                                      
										<div id="deg" class="modal fade">
								      		<div class="modal-dialog " >
								      			<div class="modal-content">
								      				<div class="modal-header">
								      					 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> 
								      				</div>
								      				<div class="modal-body">
									      				<div>
									      					<img alt="身份证正反照片" src="${imageRootPath}${item.degreeImg}" style="height: 100%;width: 100%">
									      				</div>
								      				</div>
								      			</div>
								      		</div>
										</div>
                                    <%--毕业证照片 --%>                                      
										<div id="grad" class="modal fade">
								      		<div class="modal-dialog " >
								      			<div class="modal-content">
								      				<div class="modal-header">
								      					 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> 
								      				</div>
								      				<div class="modal-body">
									      				<div>
									      					<img alt="身份证正反照片" src="${imageRootPath}${item.graduationImg}" style="height: 100%;width: 100%">
									      				</div>
								      				</div>
								      			</div>
								      		</div>
										</div>
                                    <%--资格证照片 --%>                                      
										<div id="qua" class="modal fade">
								      		<div class="modal-dialog " >
								      			<div class="modal-content">
								      				<div class="modal-header">
								      					 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> 
								      				</div>
								      				<div class="modal-body">
									      				<div>
									      					<img alt="身份证正反照片" src="${imageRootPath}${item.qualificationImg}" style="height: 100%;width: 100%">
									      				</div>
								      				</div>
								      			</div>
								      		</div>
										</div>
                                    <%--执业证照片 --%>                                      
										<div id="cert" class="modal fade">
								      		<div class="modal-dialog " >
								      			<div class="modal-content">
								      				<div class="modal-header">
								      					 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> 
								      				</div>
								      				<div class="modal-body">
									      				<div>
									      					<img alt="身份证正反照片" src="${imageRootPath}${item.certificationImg}" style="height: 100%;width: 100%">
									      				</div>
								      				</div>
								      			</div>
								      		</div>
										</div>	
                                    <%--职称证照片 --%>                                      
										<div id="pro" class="modal fade">
								      		<div class="modal-dialog " >
								      			<div class="modal-content">
								      				<div class="modal-header">
								      					 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> 
								      				</div>
								      				<div class="modal-body">
									      				<div>
									      					<img alt="身份证正反照片" src="${imageRootPath}${item.professionalTitleImg}" style="height: 100%;width: 100%">
									      				</div>
								      				</div>
								      			</div>
								      		</div>
										</div>																																																											
                            	</div>
                            
 			<script type="text/javascript">
				clickButtonToModal("bt-potr","potr");
				clickButtonToModal("bt-idenPos","idenPos");
				clickButtonToModal("bt-idenNeg","idenNeg");
				clickButtonToModal("bt-deg","deg");
				clickButtonToModal("bt-grad","grad");
				clickButtonToModal("bt-qua","qua");
				clickButtonToModal("bt-cert","cert");
				clickButtonToModal("bt-pro","pro");
			</script>
<script src="assets/js/bootstrap-fileupload.js"></script>					
  </body>
</html>